package oojo.data.spec.sub;

import oojo.data.spec.Fetch;
import oojo.data.spec.Filter;

/**
 * List all entities relative to a parent. 
 */
public class SubFetch<E> extends Fetch<E> {

    private Object parentId;

    public SubFetch() {}
    
    public SubFetch(int offset, int limit, String order, Filter filter, String... join) {
        this(null, offset, limit, order, filter, join);
    }
    
    public SubFetch(Object parentId, int offset, int limit, String order, Filter filter, String... join) {
        super(offset, limit, order, filter, join);
        setParentId(parentId);
    }
    
    /**
     * The parent relative to which the entities will be retrieved.
     */
    public Object getParentId() {
        return parentId;
    }

    public void setParentId(Object parentId) {
        this.parentId = parentId;
    }
}
